Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for suppressing project events #22590

Merged
merged 2 commits into from
Mar 23, 2018
Merged

Conversation

amcasey
Copy link
Member

@amcasey amcasey commented Mar 15, 2018

VS doesn't consume (e.g.) syntaxDiag events, so there's no reason to do the work to compute their payloads.

@amcasey
Copy link
Member Author

amcasey commented Mar 15, 2018

VS appears to have begun to receive these events as of #19864.

Copy link
Member

@sheetalkamat sheetalkamat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add test as well.

@@ -535,6 +535,7 @@ namespace ts.server {
hrtime: process.hrtime,
logger,
canUseEvents,
suppressProjectEvents,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Feels like this should be flags that indicates event to suppress given that this does not suppress ProjectInfoTelemetryEvent which is project event

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the interest of keeping the name intelligible, I decided not to incorporate that. They also don't seem conceptually related to projects.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then may be rename it to onlyTelemetryEvent or something as such?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not only telemetry. We also want TypingsInstaller events.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could call it suppressDiagnosticEvents, but then I'd feel obliged to let ProjectsUpdatedInBackgroundEvent through (which is fine, it just requires a different implementation).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed to suppressDiagnosticEvents.

@amcasey
Copy link
Member Author

amcasey commented Mar 15, 2018

Note that only versions of VS patched to pass this additional flag will benefit from the change.

@sheetalkamat
Copy link
Member

Please add test to verify this functionality

@amcasey
Copy link
Member Author

amcasey commented Mar 21, 2018

@sheetalkamat Better?

@amcasey
Copy link
Member Author

amcasey commented Mar 22, 2018

Apparently, it is unwise to use GH's merge tool. I'll redo it locally.

amcasey added 2 commits March 22, 2018 16:44
VS doesn't consume (e.g.) `syntaxDiag` events, so there's no reason to
do the work to compute their payloads.
@amcasey amcasey merged commit 6524fc5 into microsoft:master Mar 23, 2018
@amcasey amcasey deleted the DiagEvents branch March 23, 2018 00:50
@microsoft microsoft locked and limited conversation to collaborators Jul 25, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants